package com.yootk.config;

import com.yootk.regist.DefaultImportBeanDefinitionRegistrar;
import com.yootk.selector.DefaultImportSelector;
import com.yootk.vo.Dept;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import java.util.List;

/**
 * 自动装配类
 */
@Configuration
//@EnableConfigurationProperties({Dept.class})    // 启用属性配置
// 方式一：根据类名称进行注册
//@Import(Dept.class)
// 方式二：以数组的方式配置
//@Import({DefaultImportSelector.class})
// 方式三：手工进行Bean注册
@Import({DefaultImportBeanDefinitionRegistrar.class})
public class YootkAutoConfiguration {

    @Bean(name = "books")
    public List<String> getBookList() {
        return List.of("Java面向对象编程", "Java就业编程实战", "JavaWEB就业编程实战",
                "Spring就业编程实战", "SpringBoot就业编程实战", "SpringCloud就业编程实战");
    }
}
